//定义我们仓库的state
const infoData = {
    data:[1,2,3,4,5]
}
// 把你定义的state 赋值给我们reducer函数里 actions 是指将来组件派发仓库的指或逻辑
const reducer = (state = infoData,actions) => {
    //把state 做一个深拷贝
    let newState = JSON.parse(JSON.stringify(state))
    
    switch (actions.type) {
        case "BTN":
            //逻辑代码
            newState.data = actions.payload
            return newState

        case "BTN_111":
            //逻辑代码
            newState.data = actions.payload
            return newState
        default:
            return newState
    }
}

export default reducer